'''
Created on Mar 14, 2011

@author: rreyes
'''

class DeclList([].__class__):
    """ Declaration list  with specific method overloaded """
    def __and__(self, other):
        """ Intersect two declaration lists """
        new = self
        for decl in other:
            if not decl in self:
                new.append(decl)
        return new

    def __sub__(self, other):
        """ Intersect two declaration lists """
        new = []
        for decl in other:
            if not decl in self:
                new.append(decl)
        return new
